<?php
$smarty->configLoad($lang . '/calendar.module.php');
$language = parse_ini_file($lang . '/breadcrumb.module.php', true);
$breadcrumb = $language['add_calendar'];
if(isset($_POST['submit'])) {
	$main->logAction($_SESSION['id'], 'calendar_add_log', 0);
	$sql = 'INSERT INTO '.DB_CMS.'.module_calendar (start, end, userID) VALUES (:start, :end, :userID)';
	$dbh = $connection->prepare($sql);
	$dbh->bindValue(':start', $_POST['start']);
	$dbh->bindValue(':end', $_POST['end']);
	$dbh->bindValue(':userID', $_SESSION['id']);
	$dbh->execute();
	$main->jqmodal('addet');
	echo '<meta http-equiv="refresh" content="5; URL=index.php?mod=calendar">';
	}
$template = 'calendar/add.tpl';
?>
